#pragma once
#include "stdafx.h"

enum UpdatePriorit{
    UP_Pri_NoUpdate,
    UP_Pri_Suggestion,
    UP_Pri_Emergence
};

class CUpdateGoTicket
{
public:
    CUpdateGoTicket(void);
    virtual ~CUpdateGoTicket(void);

    UpdatePriorit GetUpdatePriority(){return m_upPriority;}
    wstring GetUpdateServerConfig(const wstring&);
    bool NeedUpdate(const wstring& svrConfig);
    void ParseUpdateCfgInfo(const wstring& svrCfg);
    bool DownloadUpdateFile();

private:
    bool ExtractNewVersionArch(const string& );
    bool DownloadFile(const string& url, const string& file_tosave);
    wstring GetGoTickApplicationPath();
    string GetCurrentVersion();
    BOOL ReleaseRes(TCHAR* strFileName,WORD wResID,TCHAR* strFileType);

private:
    UpdatePriorit m_upPriority;
    string        m_strlatestVersion;
    string        m_strDesc;
    vector<string> m_vecDwnUrls;
};

